package com.virjar.echo.meta.server.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 接入到平台的终端
 * </p>
 *
 * @author virjar
 * @since 2021-01-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "ClientInfo对象", description = "接入到平台的终端")
public class ClientInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "自增主建")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "终端ID")
    private String clientId;

    @ApiModelProperty(value = "对应的账户")
    private String bindAccount;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "客户端出口ip")
    private String clientOutIp;

    @ApiModelProperty(value = "最后存活时间时间")
    private Date lastAliveTime;

    @ApiModelProperty(value = "监听NatServer的ip地址")
    private String listenIp;

    @ApiModelProperty(value = "监听NatServer的端口号")
    private Integer listenPort;

    @ApiModelProperty(value = "监听的服务器id")
    private String serverId;

    @ApiModelProperty(value = "改资源是否是共享资源")
    private Boolean shared;

    @ApiModelProperty("是否在线")
    private Boolean online;

    public static final String ID = "id";

    public static final String CLIENT_ID = "client_id";

    public static final String BIND_ACCOUNT = "bind_account";

    public static final String CREATE_TIME = "create_time";

    public static final String CLIENT_OUT_IP = "client_out_ip";

    public static final String LAST_ALIVE_TIME = "last_alive_time";

    public static final String LISTEN_IP = "listen_ip";

    public static final String LISTEN_PORT = "listen_port";

    public static final String SERVER_ID = "server_id";

    public static final String SHARED = "shared";

    public static final String ONLINE = "online";
}
